package initialize

import (
	"github.com/smartwalle/alipay/v3"
	"log"
	"week3/client/global"
)

func AliInit() {
	var err error

	if global.Client, err = alipay.New(global.KAppId, global.KPrivateKey, false); err != nil {
		log.Println("初始化支付宝失败", err)
		return
	}

	// 加载证书
	if err = global.Client.LoadAliPayPublicKey(global.PublicKey); err != nil {
		log.Println("加载证书发生错误", err)
		return
	}

}
